/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.spacing.app;

import android.content.Context;
import android.graphics.*;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.*;
import android.util.AttributeSet;
import android.view.*;

public class CircleView extends View {
	private ShapeDrawable mDrawables;
	public double size = 1;
	public int width = 158;
	public int height = 158;
	
	Paint p;
	
	public CircleView(Context context) {
		super(context);
		setFocusable(true);
		p = new Paint();
		p.setColor(Color.parseColor("#d7d7d7"));
		
	}

	public CircleView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public CircleView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}
	
	@Override
	public void onDraw(Canvas canvas) {
		if(p==null){
			System.out.println("p==null");
			p = new Paint();
			p.setColor(Color.parseColor("#d7d7d7"));
		}
		canvas.drawCircle(width/2, height/2, (int)(size*(width/2)), p);
		
		invalidate();
		
		//mDrawables.setBounds(x, y, x + width, y + height);
		//mDrawables.draw(canvas);
	}
}
